package com.paic.mario.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.paic.mario.dao.SystemMapper;
import com.paic.mario.domain.CollectedObject;
import com.paic.mario.domain.ServiceTempletVo;
import com.paic.mario.service.SystemService;

@Service
public class SystemServiceImpl implements SystemService{

	@Autowired
	private SystemMapper systemMapper;
	
	@Override
	public List<Map<String, Object>> getSystemBySeriesId(int series_id) {
		return systemMapper.getSystemBySeriesId(series_id);
	}

	@Override
	public List<Map<String, Object>> getObjectBySystemId(int system_id) {
		return systemMapper.getObjectBySystemId(system_id);
	}
	
	@Override
	public List<Map<String, Object>> getAppObjectBySystemId(int system_id) {
		return systemMapper.getAppObjectBySystemId(system_id);
	}
	
	@Override
	public List<Map<String, Object>> getServiceObjectByAppId(int app_id) {
		return systemMapper.getServiceObjectByAppId(app_id);
	}

	@Override
	public List<Map<String, Object>> getServiceByObjectId(int system_id) {
		return systemMapper.getServiceByObjectId(system_id);
	}

	@Override
	public List<Map<String, Object>> getTempletByObjectId(int object_id) {
		return systemMapper.getTempletByObjectId(object_id);
	}
	
	@Override
	public List<Map<String, Object>> getTempletByObjectIds(List<Integer> object_ids) {
		return systemMapper.getTempletByObjectIds(object_ids);
	}
	

	@Override
	public List<Map<String, Object>> getSelectedTempletByObjectId(int object_id) {
		return systemMapper.getSelectedTempletByObjectId(object_id);
	}

	@Override
	public List<Map<String, Object>> getIndexByServiceId(int object_id) {
		return systemMapper.getIndexByServiceId(object_id);
	}

	@Override
	public int addServiceTemplet(List<Map> list) {
		int cnt = 0;
		cnt += systemMapper.addServiceTemplet(list);
		return cnt;
	}

	@Override
	public int delServiceTemplet(Map map) {
		int cnt = 0;
		cnt += systemMapper.delServiceTemplet(map);
		return cnt;
	}

	@Override
	public String getTempContent(int templet_id) {
		return systemMapper.getTempContent(templet_id);
	}

	@Override
	public List<Map<String, Object>> getTempProperties(List<String> list) {
		return systemMapper.getTempProperties(list);
	}

	@Override
	public String getTempJsonText(int id) {
		return systemMapper.getTempJsonText(id);
	}

	@Override
	public Map addOneServiceTemplet(ServiceTempletVo insert_Vo) {
		Map map =new HashMap();
		int cnt = systemMapper.addOneServiceTemplet(insert_Vo);
		int id = insert_Vo.getId();
		map.put("cnt", cnt);
		map.put("id", id);
		return map;
	}

	@Override
	public int updateOneServiceIndextemplateid(Map map) {
		return systemMapper.updateOneServiceIndextemplateid(map);
	}

	@Override
	public Map getServiceTempletConfig(int id) {
		return systemMapper.getServiceTempletConfig(id);
	}

	@Override
	public int getTempId(int id) {
		return systemMapper.getTempId(id);
	}

	@Override
	public List<Map<String, Object>> getMasterBySystemId(int system_id) {
		return systemMapper.getMasterBySystemId(system_id);
	}

	@Override
	public int stopMasterTemplet(int obj_id) {
		return systemMapper.stopMasterTemplet(obj_id);
	}

	@Override
	public int startMasterTemplet(int obj_id) {
		return systemMapper.startMasterTemplet(obj_id);
	}

	@Override
	public List<Map<String, Object>> getUnuseTmp(int obj_id) {
		return systemMapper.getUnuseTmp(obj_id);
	}

	@Override
	public List<Map<String, Object>> getHostInfoByObjectId(int object_id) {
		return systemMapper.getHostInfoByObjectId(object_id);
	}

	@Override
	public List<Map<String, Object>> getPropertiesInfoByObjectId(Map obj_map) {
		return systemMapper.getPropertiesInfoByObjectId(obj_map);
	}

	@Override
	public int addObject(CollectedObject cobj) {
		return systemMapper.addObject(cobj);
	}

	@Override
	public int updateObject(CollectedObject cobj) {
		return systemMapper.updateObject(cobj);
	}

	@Override
	public int delObject(int object_id) {
		return systemMapper.delObject(object_id);
	}

	@Override
	public List<Map<String, Object>> getHostTemplet(List<Integer> object_ids) {
		return systemMapper.getHostTemplet(object_ids);
	}

//	@Override
//	public List<Map<String, Object>> getHostInfoByHostName(String host_name) {
//		// TODO Auto-generated method stub
//		return systemMapper.getHostInfoByHostName(host_name);
//	}

	@Override
	public List<Map<String, Object>> getHostInfoByHostName(Map map) {
		return systemMapper.getHostInfoByHostName(map);
	}

	@Override
	public List<Map<String, Object>> getHostPropertiesByHostName(Map obj_map) {
		return systemMapper.getHostPropertiesByHostName(obj_map);
	}

	@Override
	public Long getIndexTempId(int object_id) {
		return systemMapper.getIndexTempId(object_id);
	}

	@Override
	public List<Map<String, Object>> getIndexPropertyByIndexTempId(String IndexTempId) {
		return systemMapper.getIndexPropertyByIndexTempId(IndexTempId);
	}

	@Override
	public List<Map<String, Object>> getObjProperties(int type_id) {
		return  systemMapper.getObjProperties(type_id);
	}

	@Override
	public int addObjectProperties(List<Map<String, Object>> propertiesList) {
		return systemMapper.addObjectProperties(propertiesList);
	}

	

}
